import 'package:flutter/material.dart';
import 'package:get/get.dart';

class MyThemePage extends StatelessWidget {
  static const String route = "/MyThemePage";

  const MyThemePage({super.key});

  @override
  Widget build(BuildContext context) {
    // ThemeData lightTheme = ThemeData(
    //   brightness: Brightness.light,
    //   primarySwatch: Colors.green,
    //   backgroundColor: Colors.green,
    //   dividerColor: Colors.green,

    //   // 其他配置...
    //   // 其他配置...
    // );

    // ThemeData darkTheme = ThemeData(
    //   brightness: Brightness.dark,
    //   primarySwatch: Colors.blue,
    //   backgroundColor: Colors.blue,
    //   dividerColor: Colors.blue,

    //   // 其他配置...
    // );
    return Scaffold(
      appBar: AppBar(
        title: const Text("切换主题"),
      ),
      body: Center(
          child: ElevatedButton(
        onPressed: () {
          Get.changeTheme(Get.isDarkMode ? ThemeData.light() : ThemeData.dark());
        },
        child: Text("是否黑色主题 -> ${Get.isDarkMode}"),
      )),
    );
  }
}
